3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
For a light to affect a model in a view, you need to insert the light into the light group associated with the view. You call Q3LightGroup_New to create a new (empty) light group and Q3Group_AddObject to add lights to that group. Then you need to call Q3View_SetLightGroup to attach the light group to a view. Finally, you need to create an illumination shader that specifies the kind of illumination model you want applied to objects in the model. For example, to provide Phong illumination on the objects in a model, you can create an illumination shader by calling Q3PhongIllumination_New . The illumination shader is not explicitly associated with the view. Instead, you specify the illumination shader by calling Q3Shader_Submit in your rendering loop. See the chapter "Shader Objects" for details.
Previous | QD3D Book | Overview | Chapter Contents | Next |